package com.icss.controller;

import com.icss.service.OrderService;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author safe
 * @create 2022-09-01 17:02
 * @introduction
 */
@RestController
public class OrderController {
    private final OrderService orderService;
    public OrderController(OrderService orderService) {
        this.orderService = orderService;
    }

    @GetMapping("/logistic/hystrix/TimeOut/{id}")
    public String logisticTimeout(@PathVariable("id") Integer id){
        return orderService.logisticTimeout(id);
    }

    @GetMapping("/logistic/hystrix/success/{id}")
    public String logisticSuccess(@PathVariable("id") Integer id){
        return orderService.logisticSuccess(id);
    }

}
